import json
import os

# It is the header for message which logger publish.
LOGGER_PUB_CHANNEL = "1001"
# It is IP port which logger pulish message.
LOGGER_PUB_PORT = 9000
# Heartbeat of logger
LOGGER_HEARTBEAT_CHANNEL = "1002"
# Heartbeat interval, unit is second.
LOGGER_HEARTBEAT_INTERVAL = 1

# The following part is configuration information for logger XX&YY.
XX_SUB_CHANNEL = "2001"
XX_SUB_PORT = 9001

YY_SUB_CHANNEL = "3001"
YY_SUB_PORT = 9002



#=================The following part is old one====================
# config_dir = os.path.expanduser('~/testerconfig')
# config_file = os.path.join(config_dir, 'zmqports.json')
# f = open(config_file, 'rU')
# config = json.load(f)
# f.close()

# PUB_CHANNEL = str(config['PUB_CHANNEL'])
# TEST_ENGINE_PORT = config['TEST_ENGINE_PORT']
# TEST_ENGINE_PUB = config['TEST_ENGINE_PUB']
# SEQUENCER_PORT = config['SEQUENCER_PORT']
# SEQUENCER_PUB = config['SEQUENCER_PUB']
# TE_PROXY_PUB = config['TE_PROXY_PUB']
# SEQUENCER_PROXY_PUB = config['SEQUENCER_PROXY_PUB']
# DATALOGGER_PORT = config['DATALOGGER_PORT']
# DATALOGGER_PUB = config['DATALOGGER_PUB']
# DEBUG_LOGGER_PORT = config['DEBUG_LOGGER_PORT']
# SM_PUB = config['SM_PUB']
# SM_RPC_PUB = config['SM_RPC_PUB']
# SM_PROXY_PUB = config["SM_PROXY_PUB"]
# SM_PORT = config['SM_PORT']
# STATEMACHINE_PORT = config['SM_PORT']
# LOGGER_PUB = config['LOGGER_PUB']
# UART_PUB = config["UART_PUB"]
# UART2_PUB = config["UART2_PUB"]
# ARM_PUB = config["ARM_PUB"]
# FIXTURE_PUB = config["FIXTURE_CTRL_PUB"]

# PWR_SEQUENCER_PUB = config["PWR_SEQUENCER_PUB"]
# AUDIO_PUB = config["AUDIO_PUB"]
# SPDIF_PUB = config["SPDIF_PUB"]
# HDMI_PUB = config["HDMI_PUB"]
# BACKLIGHT_PUB = config["BKLT_PUB"]

# PUB_PORT = config['PUB_PORT']  # this is our magic number between a server port and a publisher port
